home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Programming / RJTextEd.exe / {userappdata} / RJ TextEd / Scripts / examples / OutputForm.cpp < prev    next >
Encoding:
Text File  |  2009-04-26  |  819 b   |  44 lines

  1. TForm f;
  2. TListbox l;
  3. TButton b;
  4.  
  5. void ButtonClick(TButton Sender)
  6. {
  7.   f.ModalResult = mrOk;
  8. }
  9.  
  10. {
  11.    string s = "1. First line\n2. Second line";
  12.    
  13.    f = new TForm(nil);
  14.    f.Caption = "MyApp...";
  15.    f.BorderStyle = bsSizeable;
  16.    f.Position = poScreenCenter;
  17.    f.Width = 400;
  18.    f.Height = 300;
  19.    int w = f.ClientWidth;
  20.    int h = f.ClientHeight;
  21.    
  22.    l = new TListBox(f);
  23.    l.Name = "lbData";
  24.    l.Parent = f;
  25.    l.SetBounds(1, 1, w - 1, h - 35);
  26.    l.Anchors = akLeft+akTop+akRight+akBottom;
  27.    l.Items.Text = s; 
  28.    
  29.    b = new TButton(f);
  30.    b.Name = "btnClose";
  31.    b.Parent = f;
  32.    b.SetBounds(w - 80, h - 30, 75, 25);
  33.    b.Anchors = akRight+akBottom;
  34.    b.Caption = "Close";
  35.  
  36.    b.OnClick = &ButtonClick; 
  37.    
  38.    // Show the dialog
  39.    f.ShowModal;
  40.    f.Free;
  41.  
  42. }
  43.  
  44.